import 'package:get/get.dart';
import 'package:share_fit/app/models/home/spo2_model.dart';
import 'package:share_fit/app/models/home/date_type_enum.dart';
import 'package:share_fit/app/tools/date_tool.dart';

class Spo2State {
  final List<DateType> dateTypes = <DateType>[].obs;
  final Rx<DateType> selectedDateType = DateType.day.obs;

  /// 右上角日历选择的日期
  DateTime selectedDate = DateTime.now();

  String summary = '--';

  Spo2Summary spo2AvgList = Spo2Summary();
  List<Spo2Summary> spo2Summarys = <Spo2Summary>[].obs;

  /// 保存有血氧记录的日期列表
  Map<DateTime, List<bool>> dateListOfRecord = {};

  /// 保存平均值、最大值、最小值
  Map dataDetail = {'avg_oxygen_value': '--', 'max_oxygen_value': '--', 'min_oxygen_value': '--'};

  String dateRangeText = DateTool.getYMDWithDash(DateTime.now()).replaceAll('-', '/');

  int dateTypeBarIndex = 0;

  Spo2State() {
    ///Initialize variables
    dateTypes.addAll([DateType.day, DateType.week, DateType.month, DateType.year]);
  }
}
